﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using frm_timkiem.Controller;

namespace frm_timkiem
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        private void Form1_Load(object sender, EventArgs e)
        {
            cmbDieuKien.SelectedIndex = 0;
        }
        TimKiemController tkctrl = new TimKiemController();

        private void btnTimKiem_Click(object sender, EventArgs e)
        {
            DataTable tb= tkctrl.xulytimkiem(txtMatHang.Text,cmbDieuKien.Text,txtSoLuong.Text);
            BindingSource bs = new BindingSource();
            bs.DataSource = tb;
            dgvTimKiem.DataSource = bs;
            bn.BindingSource = bs;
        }
    }
}
